	function isMethodType(s){
		return /\b(function|object)\b/i.test(s);
	}

	function isPhoneFormat(v){
		var Phone10Digit = /08\d{8}$/;
		var Phone9Digit = /0[2-7]\d{7}$/;

		if ( (Phone10Digit.test(v)) || (Phone9Digit.test(v)) ){
			return true;
		}else{
			return false;
		}
	}

	function genSpace(phone, i){
		var temp = "";
		if (phone.length==9){
			temp += "&nbsp;&nbsp;";
		}
		if (i < 9){
			temp += "&nbsp;&nbsp;";
		}
		return phone + temp;
	}

	//change index from interval to time
	//exam : getTimeFromIndex(0)		>>		00.00
	//exam : getTimeFromIndex(47)		>>		23.30
	//exam : getTimeFromIndex(48)		>>		24.00
	function getTimeFromIndex(v){
		var value = parseInt(v);
		var i = parseInt(value * 0.5);

		var hour = "";
		if (i < 10){
			hour = "0" + i;
		}else{
			hour = i;
		}
		
		var min = "";
		if ((value % 2)==1){
			min = ".30";
		}else{
			min = ".00";
		}
		return hour + min;
	}

	function checkIsConflict(TimeList_1, TimeList_2, TimeList_3, TimeList_4){
		if ( ((TimeList_1>=TimeList_3) && (TimeList_1<TimeList_4)) 
			|| ((TimeList_2>TimeList_3) && (TimeList_2<=TimeList_4))
			|| ((TimeList_3>=TimeList_1) && (TimeList_3<TimeList_2))
			|| ((TimeList_4>TimeList_1) && (TimeList_4<=TimeList_2)) ){
			return true;
		}else{
			return false;
		}
	}

	function checkConflict(st, en, list){
		if (list=="")
			return false;
		
		var arr = list.split(",");
		var TimeList_1 = parseInt(st);
		var TimeList_2 = parseInt(en);
		var TimeList_3 = 0;
		var TimeList_4 = 0;
		for (var i = 0; i < arr.length; i++){
			var subArr = arr[i].split("-");
			if (subArr.length==2){
				TimeList_3 = parseInt(subArr[0]);
				TimeList_4 = parseInt(subArr[1]);
				if (checkIsConflict(TimeList_1, TimeList_2, TimeList_3, TimeList_4)){
					return true;
				}
			}
		}
		return false;
	}

	function checkConflictDate(B_DateList, W_DateList){
		if ( (B_DateList=="") || (W_DateList=="") )
			return false;

		var arr = B_DateList.split(",");
		for (var i = 0; i < arr.length; i++){
			if (W_DateList.indexOf(arr[i]) > -1)
				return true;
		}
		return false;
	}

	function doCancelService(){
		var d = document.form1;
		var w = 365;
		var h = 180;
		var l = (screen.width - w) / 2; 
		var t = (screen.height - h ) / 2; 
		var lang = d.lang.value;
		
		d.hdConfirmMsg.value = MSG_CANCEL;
		d.action = "/bp3/bin/Dspc/CallScreening";
		d.mode.value = "Cancel";
		window.open("/bp3/bin/Dspc/CallScreeningConfirm?mode=10&lang=" + lang, "CallScreeningCancel", "width=" + w + ", height=" + h + ", top=" + t + ", left=" + l);
	}

	function isSelectFullTime(DateList, TimeList){
		if (DateList.indexOf("Monday") < 0)			return false;
		if (DateList.indexOf("Tuesday") < 0)			return false;
		if (DateList.indexOf("Wednesday") < 0)	return false;
		if (DateList.indexOf("Thursday") < 0)			return false;
		if (DateList.indexOf("Friday") < 0)				return false;
		if (DateList.indexOf("Saturday") < 0)			return false;
		if (DateList.indexOf("Sunday") < 0)			return false;

		var arr = TimeList.split(",");
		if (arr.length==1){
			var subArr = arr[0].split("-");
			var time1 = parseInt(subArr[0]);
			var time2 = parseInt(subArr[1]);
			if ( (time1==0) && (time2==48) ){
				return true;
			}
		}else if (arr.length==2){
			var subArr = arr[0].split("-");
			var time1 = parseInt(subArr[0]);
			var time2 = parseInt(subArr[1]);

			var subArr2 = arr[1].split("-");
			var time3 = parseInt(subArr2[0]);
			var time4 = parseInt(subArr2[1]);

			if (time1 < time3){
				if ( (time1==0) && (time4==48) && (time2==time3) ){
					return true;
				}
			}else{
				if ( (time3==0) && (time2==48) && (time4==time1) ){
					return true;
				}
			}
		}
		return false;
	}
	
		function replaceChar(str, oChar, nChar){
		if ( (str==null) || (str=="") ){
			return "";
		}
		var len = str.length;
		var sTemp = "";
		for (var i=0; i<len; i++){
			if ( str.substr(i,1) != oChar ){
				sTemp += str.substr(i,1);
			}else{
				sTemp += nChar;
			}
		}
		return sTemp;
	}
	
	function onlyNumber(field){
		var sText = field.value;
		var filter = /^[0-9]$/;
		var Char; 
		var newText = "";
		var isInvalid = false;
		for (i = 0; i < sText.length; i++){ 
			Char = sText.charAt(i); 
			if (filter.test(Char) ) {
				newText += Char;
			}else{
				isInvalid = true;
			}
		}
		if (isInvalid){
			field.value = newText;
		}
	}